import requests
import json
import pandas as pd

def weather(city,key="d51fbd0868d98deca1f02899f79c6e8e",extensions="base",output="JSON"):
    weather_url = " https://restapi.amap.com/v3/weather/weatherInfo?parameters"
    params = {
        "key":key,
        "city":city,
        "extensions":extensions,
        "output":output
    }
    
    r = requests.get(weather_url,params=params)
    result = r.json()
    return result